{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--操作框开始-->
                <div class="col-sm-12">
                    <!--搜索框开始-->
                        <div class="input-group" >
                            <button class="btn btn-primary" type="button" onclick="history.back()">返回</button>
                        </div>
                    </div>
                    <!--搜索框结束-->
                </div>
                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div><span>总收益：{$moneys ? $moneys : 0}</span></div>
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="user_level">
    {{#  if(d.user_level == 2){ }}
    <span>城市合伙人</span>
    {{#  } else if(d.user_level == 3) { }}
    <span>事业合伙人</span>
    {{#  } else if(d.user_level == 4) { }}
    <span>推广合伙人</span>
  {{#  } }}
</script>
<script type="text/html" id="head">
    {{#  if(d.m_area_type == 1){ }}
    <span>总部</span>
    {{#  } }}
</script>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("partners/headmoney")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
                {type:'numbers', width: 80, title: '序号'}
                , {field: 'm_area_type', width: '', title: '代理', align: 'center',templet:'#head'}
                , {field: 'm_money', width: '', title: '收益', align: 'center'}
                , {field: 'user_username', width: '', title: '来自合伙人', align: 'center'}
                , {field: 'user_phone', width: '', title: '合伙人手机', align: 'center'}
                , {field: 'user_level', width: '', title: '合伙人类型', align: 'center',templet:'#user_level'}
                , {field: 'm_add_time', width: '', title: '收益时间', align: 'center'}
            ]]
        });
    });
</script>
</body>
</html>